def read2list(filename):
    file = open(filename, 'r')
    data = file.readlines()
    return data

import time

def sortmas(fname):
    a = read2list("C:\mas\\" + fname + ".txt")
    n = len(a)
    start_time = time.time()
    for i in range(n - 1):
        for j in range(n - 1 - i):
            if a[j] > a[j + 1]:
                a[j], a[j + 1] = a[j + 1], a[j]
    end_time = time.time()
    execution_time = end_time - start_time
    return int(execution_time * 1000)

fname = "m1_sorted"
print(fname + f" {sortmas(fname)} milliseconds")

fname = "m2_reverse"
print(fname + f" {sortmas(fname)} milliseconds")

fname = "m3_shuffle"
print(fname + f" {sortmas(fname)} milliseconds")
